package capillary;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Solution2 {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		int t = s.nextInt();
		Map<Integer, Integer> con = new HashMap<Integer, Integer>();
		List<Integer> conn = new ArrayList<Integer>();

		while (t-- > 0) {
			int x = s.nextInt();
			int y = s.nextInt();
			if (y < x) {
				int temp = x;
				x = y;
				y = temp;
			}

			if (con.containsKey(x) || con.containsKey(y) || x == y) {
				System.out.println("NO");
				continue;
			}
			// check overlap
			boolean overlapped = false;
			for (int i = x; i <= y; i++) {
				if (con.containsKey(i)) {
					int end = con.get(i);
					if (end < x || end > y) {
						overlapped = true;
						break;
					}
				}
			}
			if (overlapped) {
				System.out.println("NO");
			} else {
				System.out.println("YES");
				// connect --small, large
				con.put(x, y);
				con.put(y, x);
			}

		}
		s.close();
	}
}
